package com.gxa.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * 返回前端的消息封装
 */
@Data
public class Result<T> implements Serializable {

    private int code;//返回的业务码  0：成功执行  1：发生错误
    private String message;//信息

    private T data;

    public Result(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public Result(T data) {
        this.code=0;
        this.message="执行成功";
        this.data=data;
    }

    public Result() {
        this.code = 0;
        this.message = "执行成功";
    }


}
